load_jcache_edit_des = false;

jQuery(document).ready(function(){	
	jQuery(function() {
        jQuery('#product_detail a.img_thumb').lightBox();
    });	

	jQuery('#description a[@href^="http://"]').attr("target", "_blank");    
	
	
	jQuery.ifixpng('style/images/spacer.gif');
	jQuery('img').ifixpng();
});

/*function showFBFrame()
{
	src = document.getElementById("facebookLike").src;
	if (src != "")
	{
		// Loaded
		document.getElementById("facebookLike").style.display = '';
	}
}*/


//click chuot de copy	
function highlight(field) {
	field.focus();
	field.select();
	var urlSwf = "images/_clipboard.swf";

	window.status = 'Copied text to clipboard';

	// Copy the text inside the text box to the user's clipboard
	var flashcopier = 'flashcopier';
	var divholder = document.createElement('div');
	divholder.id = flashcopier;
	document.body.appendChild(divholder);

	divholder.innerHTML = '';
	var divinfo = '<embed src="' + urlSwf + '" FlashVars="clipboard='+escape(field.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	divholder.innerHTML = divinfo;

	return false;
}

function fn_click_reset_memcache(){

	jQuery.ajax({
			type: "POST",
			url: WEB_DIR+"ajax.php?act=item&code=remove_mem",
			data: "item_id="+item_id,
			success: function(msg) {
                    if(msg == 'not_login'){
                        log_faile ('Báº¡n pháº£i Ä‘Äƒng nháº­p má»›i thá»±c hiá»‡n Ä‘Æ°á»£c chá»©c nÄƒng nĂ y');
                        return false;
                    }else if(msg == 'no_permission'){
                        log_faile ('Báº¡n khĂ´ng cĂ³ quyá»n thá»±c hiá»‡n chá»©c nÄƒng nĂ y!');
                        return false;
                    }else if(msg == 'success'){
                        log_success ('ÄĂ£ xĂ³a cache thĂ nh cĂ´ng');
                        location.reload();
                    }
				}
			});
}


function show_tab(tab_id)
{
	jQuery('.des_tab').removeClass('active');
	
	jQuery('#header_tab_'+tab_id).addClass('active');
	
	jQuery('.tab_content').removeClass('hide').hide();
	
	jQuery('#tab'+tab_id).show();
}